<!-- vue-zhu/src/indexpage/index.vue -->
<template>
  <component :is="currentComponent"></component>
</template>

<script>
import ControlerPage from './components/controler_page.vue';
import BuyerPage from './components/buyer_page.vue';
import SellerPage from './components/seller_page.vue';

export default {
  name: '',
  data () {
    return {
      currentComponent: null
    }
  },
  created () {
    const userType = localStorage.getItem('loggedInUserType'); // 从单独的键获取用户类型
    
    if (userType === '管理员') {
      this.currentComponent = ControlerPage;
    } else if (userType === '买家') {
      this.currentComponent = BuyerPage;
    } else if (userType === '卖家') {
      this.currentComponent = SellerPage;
    }
  },
  methods: {},
  mounted() {},
  computed: {}
}
</script>

<style scoped>
@import '../assets/css/indexpage.css';
</style>